/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ServicesAccessData;

import org.apache.thrift.server.TNonblockingServer;
import org.apache.thrift.server.TServer;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TNonblockingServerTransport;
import org.apache.thrift.transport.TTransportException;
import org.apache.thrift.server.THsHaServer;


/**
 *
 * @author huy
 */
public class NonblockingServerUser {
    private void start() {
        try {
            TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(7911);
            User.Processor processor = new User.Processor(new UserImpl());
            THsHaServer.Args args = new THsHaServer.Args(serverTransport);
            args.workerThreads(20);
            args.processor(processor);
            
            
            TServer server = new THsHaServer(args);
            System.out.println("Starting server on port 7911 ...");
            server.serve();
        } catch (TTransportException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        NonblockingServerUser srv = new NonblockingServerUser();
        srv.start();
    }
}

